import { BaseSkill } from '../BaseSkill';
import { DamageType, SkillType } from '../../types';
import { General } from '../../models/General';
import { Battle } from '../../models/Battle';

export class LongDanKangFen extends BaseSkill {
  constructor() {
    super(
      'longDanKangFen',
      '龙胆亢奋',
      SkillType.Passive,
      DamageType.None,
      0.5,  // 50% 触发概率
      3,    // 3回合CD
      2     // 2回合持续
    );
  }

  execute(source: General, battle: Battle): void {
    if (!this.canUse() || Math.random() > this.probability) return;

    source.addEffect({
      type: 'dodge',
      value: 1,
      duration: this.duration,
      stackable: false
    });

    this.startCooldown();
  }
}
